package com.xd.center.http.annotation;

import java.lang.annotation.*;

/**
 * @comment @HttpLine("POST /api/findIndexRanking") 0: RequestMethod, 1: path not domain name
 * @see HttpClient
 * demo @HttpLine("POST /user/list1") Object findIndexTrend1(@RequestBody Bean requestBean);
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
//@Headers({"Content-Type: application/json", "Accept: application/json"})
public @interface HttpHeader {

  @Deprecated
  String authName() default ""; //bean context名称

  @Deprecated
  String authReflex() default ""; //class全路径

  String[] value() default ""; //{"Content-Type: application/json", "Accept: application/json"}

  boolean openAuth() default true; //身份认证, true:开启, false:关闭

  MediaType consumes() default MediaType.JSON; //请求

  MediaType produces() default MediaType.JSON; //返回

  enum MediaType {
    JSON,
    FORM_URLENCODED,
    MULTIPART_FORM_DATA,
    TEXT,
    DOWNLOAD,
    URL_PARAM, //GET地址栏参数
  }
}
